package main

import (
	"fmt"
	"io"
	"os"
)

func main() {
	var a string
	// pair<static type:string, value:"abcd">
	a = "abcd"

	// pair<static type:string, value:"abcd">
	var allType interface{}
	allType = a

	var str, _ = allType.(string)
	fmt.Println(str)

	//tty: pair<type:*os.File, value:""文件描述符>
	tty, err := os.OpenFile("../files/testfile.txt", os.O_RDWR, 0)

	if err != nil {
		fmt.Println("Open file error, ", err)
	}
	//tty: pair<type:*os.File, value:""文件描述符>
	var r io.Reader
	r = tty

	//tty: pair<type:*os.File, value:""文件描述符>
	var w io.Writer
	w = r.(io.Writer)

	w.Write([]byte("Hello, this is a test!!!\n"))
}
